<!--  子类分析 -->
<template>
  <div class="clas_All">
    <!-- <el-form class="const_top" :model="queryParams" size="small" :inline="true">
      <el-row>
        <el-col style="padding: 10px" :span="10">
          <el-form-item prop="" style="height: 40px">
            <el-date-picker
              clearable
              v-model="queryParams.createdTime"
              type="date"
              value-format="yyyy-MM-dd"
              placeholder="请选择创建时间"
            >
            </el-date-picker>
          </el-form-item>
          <el-form-item prop="" style="height: 40px">
            <el-select
              v-model="queryParams.revision"
              placeholder="1号至10号"
              clearable
            >
              <el-option
                v-for="dict in examineOption"
                :key="dict.value"
                :label="dict.label"
                :value="dict.value"
              />
            </el-select>
          </el-form-item>
        </el-col>
        <el-col :span="4" style="padding: 10px">
          <el-form-item>
            <el-button type="primary" size="mini" @click="handleQuery"
              >查询
            </el-button>
          </el-form-item>
        </el-col>
      </el-row>
    </el-form> -->
    <el-table :data="tableData">
      <el-table-column align="center" prop="pname" label="原料类别">
      </el-table-column>
      <el-table-column align="center" label="实际成本/元">
        <el-table-column align="center" prop="realCostCurrent" label="本期">
        </el-table-column>
        <el-table-column align="center" prop="realCostUpper" label="上期">
        </el-table-column>
      </el-table-column>
      <el-table-column align="center" label="标准成本/元">
        <el-table-column align="center" prop="standardCostCurrent" label="本期">
        </el-table-column>
        <el-table-column align="center" prop="standardCostUpper" label="上期">
        </el-table-column>
      </el-table-column>
      <el-table-column align="center" label="损益金额/元">
        <el-table-column align="center" prop="prolossCostCurrent" label="本期">
        </el-table-column>
        <el-table-column align="center" prop="prolossCostUpper" label="上期">
        </el-table-column>
      </el-table-column>
      <el-table-column align="center" label="损益率">
        <el-table-column align="center" prop="prolossRateCurrent" label="本期">
        </el-table-column>
        <el-table-column align="center" prop="prolossRateUpper" label="上期">
        </el-table-column>
      </el-table-column>
      <el-table-column label="操作" props="" align="center">
        <template slot-scope="scope">
          <div>
            <el-button size="mini" type="text" @click="GodeptW(scope.row)"
              >该部门该类物料损益分析</el-button
            >
            <!-- <el-button size="mini" type="text">子类损益分析</el-button> -->
          </div>
        </template>
      </el-table-column>
    </el-table>
  </div>
</template>

<script>
import { stapprolossPage } from "@/api/system/cost";
export default {
  props: {
    dataOne: {
      type: Array,
    },
  },
  data() {
    return {
      queryParams: {},
      examineOption: [],
    };
  },
  created() {
    this.queryParams.shopCode = this.$route.query.shopCode;
    this.queryParams.pandianCode = this.$route.query.pandianCode;
    this.queryParams.stapTypeCode = this.$route.query.stapType;
    this.getList();
  },
  methods: {
    handleQuery() {},
    getList() {
      stapprolossPage(this.queryParams).then((res) => {
        if (res.code == 200) {
          this.tableData = res.data;
          this.$forceUpdate();
        }
      });
    },
    GodeptW(v) {
      this.$router.push({
        path: "/ProfitDepartment",
        query: {
          pandianCode: this.queryParams.pandianCode,
          shopCode: this.queryParams.shopCode,
          deptCode: v.deptCode,
          stapTypeCode: this.queryParams.stapTypeCode,
        },
      });
      // sectoralAnalysis/ProfitDepartment 该部门该类损益分析
    },
  },
};
</script>

<style lang="scss" scoped>
.clas_All {
  margin: 20px;
}
</style>
